package router

import (
	"go_final/mxshop_api/order_web/api/shopCart"
	middlewares "go_final/mxshop_api/order_web/middleware"

	"github.com/gin-gonic/gin"
)

func InitShopCartRouter(Router *gin.RouterGroup) {
	ShopCartRouter := Router.Group("shopcarts").Use(middlewares.JWTAuth())

	{
		ShopCartRouter.GET("", shopCart.List)
		ShopCartRouter.DELETE(":id", shopCart.Delete) // 删除购物车商品
		ShopCartRouter.POST("", shopCart.New)         // 添加商品到购物车
		ShopCartRouter.PATCH(":id", shopCart.Update)  // 添加商品到购物车
	}
}
